﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace BaoJian.Control.local
{
    public partial class ExchangeProductImageList : System.Web.UI.UserControl
    {
        public string Sql;
        public int Count;    
        public string ColumnID;

        public string URLPage;
        public string Keyword;
        public string OutDivCSS;
        public string PicDivCSS;
        public string TitleDivCSS;
    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Sql = "SELECT top 2 PID AS ID,PName AS Title,REPLACE(ImagePath,'~','..\') AS ImagePath FROM dbo.ExchangeProduct WHERE pid  IN ( SELECT TOP {0} pid FROM dbo.RecommendProduct WHERE PColumn='{1}')";
                Sql = string.Format(Sql, Count,ColumnID);
                DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(Sql);
                Repeater1.DataSource = ds.Tables[0];
                Repeater1.DataBind();               
            }
        }
    }
}